const install = (Vue, vm) => {
	const checkAuth = () => {
		const auth = uni.getStorageSync('user');
		console.log('server---auth', auth);
		if (!auth || JSON.stringify(auth) === '{}' || auth.type === '') {
			uni.showToast({
				title: '请刷身份证登陆！'
			})
			uni.$u.route({
				// type: 'reLaunch',
				url: '/pages/home/index'
			});
			return false;
		} else {
			return auth;
		}
	};

	uni.$u.auth = {
		check: checkAuth
	};
};

module.exports = {
	install
};